
#include <stdio.h>
#include <Helmholtz\Helmholtz.h>
#include <Audio\AudioFileOut.h>
#include <Config\ParserFileName.h>

void main(int argc, char * const argv[]){


	
	if (argc == 3){
		Option config;

		config.Load(std::string(argv[2]));

		ListFile listfile;
		listfile.load(std::string(argv[1]));
		for (int i = 0; i < listfile.size(); i++){
			OptionHelmholtz Chan;
			config.SetOptionHelmholtz(&Chan);
			PaserName tm = listfile[i];
			tm.GetInfoChan(&Chan);
			Helmholtz hel;
			audio::AudioFile in;
			in.Load(const_cast<char *>(tm.getPath().c_str()));
			in.GetDataChan(&Chan);

			hel.SetChan(&Chan);
			hel.SetOption(config);
			hel.processing();

			audio::AudioFileOut out(in, tm, config);
			hel.Save(out);
			
			out.Save();
		}
	}
		




	//OptionHelmholtz optionChan;
	//Option config;
	//config.BlockSize = 1024;

	//optionChan.Pitch_Graph = 1;
	//
	//PaserName paser("D:\\_half_violin_half_guitar(stereo)`n=A#2.wav  w=200");
	//paser.GetInfoChan(&optionChan);
	//Helmholtz hel;
	//audio::AudioFile in;
	//in.Load(const_cast<char *>(paser.getPath().c_str()));
	//in.GetDataChan(&optionChan);

	//hel.SetChan(&optionChan);
	//hel.SetOption(config);
	//hel.processing();
	//
	//audio::AudioFileOut out(in, paser, config);
	//out.AddChannel(hel.getPitchGraph());
	//out.Save();
}